package com.learn.temp.rmi;

import java.io.IOException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;

/**
 * @author wangxing
 * @version 2020/6/7 19:01 Administrator
 */
public class RmiServer {
    public static void main(String[] args) throws IOException, AlreadyBoundException {
        UserService userService = new UserServiceImpl();
        String name = "rmi://localhost:8080/UserService";
        Naming.bind(name, userService);
        System.out.println("服务已发布");
        System.in.read();
    }
}
